home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / basic / qbfaqr01.zip / ARCSINE.BAS < prev    next >
BASIC Source File  |  1992-08-10  |  648b  |  16 lines

  1. 'Date: 03-24-92 (16:16)
  2. 'From: DAVID WILLIAMS
  3. 'Subj: INVERTING 'COS'
  4. '-------------------------------------------------------------------------
  5. 'PI=4*ATN(1)
  6. 'DEF FNARCSIN(X)=ATN(X/SQR(1-X*X))
  7. 'DEF FNARCCOS(X)=PI/2-FNARCSIN(X)
  8.  
  9. 'These will give you the arc-cosine (or the arc-sine) of any number that
  10. 'is LESS than one and GREATER than -1. If you think you will ever get the
  11. 'exact values 1 or -1, which are legal arguments for the functions but
  12. 'which produce a "divide by zero" error in FNARCSIN, you must take care
  13. 'to trap them out and treat them separately.
  14.  
  15. 'The results are in radians. If you want degrees, multiply by 180/PI.
  16.